3.47 \(\int (a+a \sec (c+d x)) (A+B \sec (c+d x)) \, dx\)

Optimal. Leaf size=32 \[ \frac{a (A+B) \tanh ^{-1}(\sin (c+d x))}{d}+a A x+\frac{a B \tan (c+d x)}{d} \]

[Out]

a*A*x + (a*(A + B)*ArcTanh[Sin[c + d*x]])/d + (a*B*Tan[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0331723, antiderivative size = 32, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3914, 3767, 8, 3770} \[ \frac{a (A+B) \tanh ^{-1}(\sin (c+d x))}{d}+a A x+\frac{a B \tan (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[(a + a*Sec[c + d*x])*(A + B*Sec[c + d*x]),x]

[Out]

a*A*x + (a*(A + B)*ArcTanh[Sin[c + d*x]])/d + (a*B*Tan[c + d*x])/d

Rule 3914

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_)), x_Symbol] :> Simp[a*c*x, x]
 + (Dist[b*d, Int[Csc[e + f*x]^2, x], x] + Dist[b*c + a*d, Int[Csc[e + f*x], x], x]) /; FreeQ[{a, b, c, d, e,
f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int (a+a \sec (c+d x)) (A+B \sec (c+d x)) \, dx &=a A x+(a B) \int \sec ^2(c+d x) \, dx+(a (A+B)) \int \sec (c+d x) \, dx\\ &=a A x+\frac{a (A+B) \tanh ^{-1}(\sin (c+d x))}{d}-\frac{(a B) \operatorname{Subst}(\int 1 \, dx,x,-\tan (c+d x))}{d}\\ &=a A x+\frac{a (A+B) \tanh ^{-1}(\sin (c+d x))}{d}+\frac{a B \tan (c+d x)}{d}\\ \end{align*}

Mathematica [A]  time = 0.0162481, size = 43, normalized size = 1.34 \[ \frac{a A \tanh ^{-1}(\sin (c+d x))}{d}+a A x+\frac{a B \tan (c+d x)}{d}+\frac{a B \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Sec[c + d*x])*(A + B*Sec[c + d*x]),x]

[Out]

a*A*x + (a*A*ArcTanh[Sin[c + d*x]])/d + (a*B*ArcTanh[Sin[c + d*x]])/d + (a*B*Tan[c + d*x])/d

________________________________________________________________________________________

Maple [A]  time = 0.032, size = 65, normalized size = 2. \begin{align*} aAx+{\frac{Aa\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}+{\frac{Aac}{d}}+{\frac{Ba\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}+{\frac{Ba\tan \left ( dx+c \right ) }{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*sec(d*x+c))*(A+B*sec(d*x+c)),x)

[Out]

a*A*x+1/d*A*a*ln(sec(d*x+c)+tan(d*x+c))+1/d*A*a*c+1/d*B*a*ln(sec(d*x+c)+tan(d*x+c))+a*B*tan(d*x+c)/d

________________________________________________________________________________________

Maxima [A]  time = 1.00014, size = 76, normalized size = 2.38 \begin{align*} \frac{{\left (d x + c\right )} A a + A a \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + B a \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + B a \tan \left (d x + c\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))*(A+B*sec(d*x+c)),x, algorithm="maxima")

[Out]

((d*x + c)*A*a + A*a*log(sec(d*x + c) + tan(d*x + c)) + B*a*log(sec(d*x + c) + tan(d*x + c)) + B*a*tan(d*x + c
))/d

________________________________________________________________________________________

Fricas [B]  time = 0.489232, size = 220, normalized size = 6.88 \begin{align*} \frac{2 \, A a d x \cos \left (d x + c\right ) +{\left (A + B\right )} a \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) -{\left (A + B\right )} a \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, B a \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))*(A+B*sec(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(2*A*a*d*x*cos(d*x + c) + (A + B)*a*cos(d*x + c)*log(sin(d*x + c) + 1) - (A + B)*a*cos(d*x + c)*log(-sin(d
*x + c) + 1) + 2*B*a*sin(d*x + c))/(d*cos(d*x + c))

________________________________________________________________________________________

Sympy [A]  time = 13.4574, size = 71, normalized size = 2.22 \begin{align*} \begin{cases} \frac{A a \left (c + d x\right ) + A a \log{\left (\tan{\left (c + d x \right )} + \sec{\left (c + d x \right )} \right )} + B a \log{\left (\tan{\left (c + d x \right )} + \sec{\left (c + d x \right )} \right )} + B a \tan{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \left (A + B \sec{\left (c \right )}\right ) \left (a \sec{\left (c \right )} + a\right ) & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))*(A+B*sec(d*x+c)),x)

[Out]

Piecewise(((A*a*(c + d*x) + A*a*log(tan(c + d*x) + sec(c + d*x)) + B*a*log(tan(c + d*x) + sec(c + d*x)) + B*a*
tan(c + d*x))/d, Ne(d, 0)), (x*(A + B*sec(c))*(a*sec(c) + a), True))

________________________________________________________________________________________

Giac [B]  time = 1.25726, size = 113, normalized size = 3.53 \begin{align*} \frac{{\left (d x + c\right )} A a +{\left (A a + B a\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right ) -{\left (A a + B a\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right ) - \frac{2 \, B a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 1}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))*(A+B*sec(d*x+c)),x, algorithm="giac")

[Out]

((d*x + c)*A*a + (A*a + B*a)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - (A*a + B*a)*log(abs(tan(1/2*d*x + 1/2*c) - 1
)) - 2*B*a*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 - 1))/d